import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import { lcu } from "./src/renderer/src/common/constant.js";

export default defineConfig({
  main: {
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    plugins: [externalizeDepsPlugin()]
  },
  renderer: {
    resolve: {
      alias: {
        '@renderer': resolve('src/renderer/src')
      }
    },
    server: {
      proxy: {
        [lcu]: {
          target: 'http://backend.server.com',
          changeOrigin: true,
          // 其他可选配置...
        }
      }
    },
    plugins: [vue()]
  }
})
